/*
 * @Author: jqm123 2289662078@qq.com
 * @Date: 2025-08-07 09:32:50
 * @LastEditors: jqm123 2289662078@qq.com
 * @LastEditTime: 2025-08-07 09:46:41
 * @FilePath: /anxinxiu_v3/src/stores/common.store.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineStore } from "pinia";

export const useCommonStore = defineStore("common-store", {
  state: () => ({
    currentCarIndex: sessionStorage.getItem("currentCarIndex") ?? 0,
  }),
  getters: {},
  actions: {
    setIndex(index) {
      this.currentCarIndex = index;
      sessionStorage.setItem("currentCarIndex", index);
    },
  },
});
